<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions">
<ui:include src="/pages/common/head.xhtml" />
<f:view contentType="text/html">
	<h:body>
		<ui:include src="/pages/common/loading.xhtml" />
	
	
			<p:dialog header="Primeiro Acesso" visible="true" closable="false" draggable="false" resizable="false" width="350">
			<h:form>
				<h:panelGrid columns="2" cellpadding="5" width="100%">
					<p:outputLabel for="cpf" value="CPF" styleClass="label" />
					<p:inputMask id="cpf" style="width:115px" mask="999.999.999-99" required="true" requiredMessage="Favor informar o CPF"
						value="#{primeiroAcessoController.cpf}" />

					<p:outputLabel for="pass" value="Senha Temporária" styleClass="label" />
					<p:password id="pass" style="width:115px" value="#{primeiroAcessoController.senha}" required="true"
						requiredMessage="Favor informar a senha temporária" />
				</h:panelGrid>

				<p:spacer />
				<p:spacer />

				<h:panelGrid columns="2" columnClasses=",alignRight" width="85%">
					<p:commandButton value="Cadastrar PIN" actionListener="#{primeiroAcessoController.autentica}" update="messages :pinDialog" />
					<p:button icon="ui-icon-circle-arrow-w" href="/login.jsf" value="Voltar" />
				</h:panelGrid>
				<p:messages id="messages" />
			</h:form>
		</p:dialog>

		<p:dialog header="Primeiro Acesso" visible="#{null != primeiroAcessoController.usuario}" id="pinDialog" modal="true" draggable="false"
			resizable="false" style="width: 400px;">

			<h:form>
				<h:panelGrid columns="2" cellpadding="5">
					<p:outputLabel for="pin" value="Nova Senha" styleClass="label" />
					<p:password id="pin" value="#{primeiroAcessoController.novaSenha}" validatorMessage="PIN não confere" match="pinMatch" required="true"
						requiredMessage="Favor informar o PIN" />

					<p:outputLabel for="pinMatch" value="Confirmar Nova Senha" styleClass="label" />
					<p:password id="pinMatch" value="#{primeiroAcessoController.novaSenha}" required="true" requiredMessage="Favor confirmar o PIN" />
				</h:panelGrid>

				<p:spacer />
				<p:spacer />

				<p:commandButton value="Confirmar" actionListener="#{primeiroAcessoController.primeiroAcesso}" update="messages" />
				<p:messages id="messages" />
			</h:form>

		</p:dialog>
	
		
		
	
	</h:body>
</f:view>
</html>